package com.hsj.busmanager.mapper;

import com.hsj.busmanager.api.News;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NewsMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(News record);

    int insertSelective(News record);

    News selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKey(News record);

    List<News> getNewsByUserId(Integer userId);

    List<News> getNewsPage(@Param("start") Integer start, @Param("limit")int limit,@Param("userId") Integer userId);

    int getNewsCount(Integer userId);

    int getUnReadCount(Integer userId);

    List<News> getAdminNewsPage(Integer start, int limit,@Param("news") News news);

    int getAdminNewsCount(@Param("news") News news);
}